﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SuchSofts.OpenImage.Lib.Operation.WorkingStatus
{
    internal class WorkingStatusManager
    {
        private WorkingStatus status;
        public delegate void StatusChangedEventHandler(object sender, StatusChangedEventArgs e);
        public event StatusChangedEventHandler StatusChanged = null;

        public WorkingStatusManager()
        {
            status = WorkingStatus.Ready;
        }

        public WorkingStatusManager(WorkingStatus status)
        {
            this.status = status;
        }

        public WorkingStatus Status
        {
            get
            {
                return status;
            }
            set
            {
                WorkingStatus oldStatus=status;
                status=value;

                if (StatusChanged != null)
                {
                    StatusChanged(this, new StatusChangedEventArgs(oldStatus, status));
                }
            }
        }
    }
}
